﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using HFK.DxFluentUI.LanguageModel;

namespace HFK.DxFluentUI.LanguageModel
{
  public class FeatureWithConfigurationContext<FeatureConfiguration, NextStep> : FeatureActivationWithConfigurationElement<FeatureConfiguration, NextStep>
  {
    #region public members

    public delegate NextStep AllowedImplementation();
    public delegate NextStep NotAllowedImplementation();
    public delegate FeatureConfiguration AllowedUsingImplementation();

    public FeatureWithConfigurationContext(AllowedImplementation allowedMethod, AllowedUsingImplementation allowedUsingMethod, NotAllowedImplementation notAllowedMethod)
    {
      m_allowedMethod = allowedMethod;
      m_allowedUsingMethod = allowedUsingMethod;
      m_notAllowedMethod = notAllowedMethod;
    }

    #region FeatureActivationWithConfigurationElement<FeatureConfiguration,NextStep> Members

    public FeatureConfiguration AllowedUsing()
    {
      return m_allowedUsingMethod();
    }

    #endregion

    #region FeatureActivationElement<NextStep> Members

    public NextStep Allowed()
    {
      return m_allowedMethod();
    }

    public NextStep NotAllowed()
    {
      return m_notAllowedMethod();
    }

    #endregion

    #endregion

    #region private members

    private AllowedImplementation m_allowedMethod;
    private AllowedUsingImplementation m_allowedUsingMethod;
    private NotAllowedImplementation m_notAllowedMethod;

    #endregion
  }
}
